home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-04-16 | 2.9 KB | 107 lines | [TEXT/GEOL] |
- Item forwarded by A33 to A34
-
- Item 1823566 10-April-90 13:50PDT
-
- From: AACO Arthur Andersen, Glenn A Noga,VCA
-
- To: D4684 Robins Analytics, S Robins,PRT
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: Re: Re: Setting Print record…
-
- Doug,
- Thanks for the tip on saving the print record as a resource. After digging
- around some more, I was able to set up my default print record with the
- following code:
-
- FUNCTION TSaleRPrintHandler.DoMenuCommand(aCmdNumber: CmdNumber): TCommand;
- OVERRIDE;
-
- TYPE
- TXWord = PACKED RECORD
- CASE INTEGER OF
- 0:
- (c1, c0: CHAR);
- 1:
- (b1, b0: SignedByte);
- 2:
- (f15, f14, f13, f12, f11, f10, f9, f8, f7, f6, f5, f4, f3, f2, f1, f0:
- BOOLEAN);
- 3:
- (i0: INTEGER);
- END;
-
- MyPrXInfo = RECORD{ This is used to stuff values into the Print Record }
- dummyLong : LongInt;
- aInteger: Integer;
- adummyInt : Integer;
- dummyLong3 : LongInt;
- dummyLong4 : LongInt;
- END;
-
- CONST
- kReductionFactor = 53;
-
- VAR
- didChange : Boolean;
-
- BEGIN
- DoMenuCommand := gNoChanges;
-
- { • Handle the menu commands for printing }
- CASE aCmdNumber OF
- cPrint,
- cPageSetup,
- cPrintOne:
- BEGIN
-
-
- {• Now we need to tweak the print record so that the print view is set to be }
- { Landscape at 53% Reduction. Note that we only reduce if not dealing with a }
- { imagewriter }
-
- { we need to do this so that each time a document is printed }
- { a new, untarnished print record is created. }
- fDocument.fSharePrintInfo := FALSE;
- SELF.SetDefaultPrintInfo;
- fDocument.fSharePrintInfo := TRUE;
-
- WITH THPrint(fHPrint)^^ DO
- BEGIN
- {The orientation is set to landscape by clearing bit 14 in wdev!!! }
- BitClr(Ptr(@prStl.wdev),14);
- WITH TXWord(prStl.wDev) DO
- IF b1 <> 1 THEN { 1 = bDevCItoh => ImageWriter }
- BEGIN
- {• OK, we have a laserwriter so lets reduce the image by 53 % }
- { This is done by setting the value for the reduction percentage }
- MyPrXInfo(prXInfo).aInteger := kReductionFactor;
- END;
- END;
-
- ValidatePrintRecord(didChange);{ This call recomputes page and paper stuff}
- { based on the print driver and the reduction/}
- {$Push} {$H-} { orientation.}
- WITH fPageAreas.thePaper, fMarginRes, THPrint(fHPrint)^^ DO
- { Recompute effective device resolution to set up our own margins}
- BEGIN
- fPageAreas.theInk := prInfo.rPage;
- fPageAreas.thePaper := rPaper;
- h := (IntMultiply(iPrPgFract, right - left)) DIV prStl.iPageH;
- v := (IntMultiply(iPrPgFract, bottom - top)) DIV prStl.iPageV;
- END;
- {$POP}
-
- DoMenuCommand := INHERITED DoMenuCommand(aCmdNumber);
- END;
-
- This has the advantage of dealing with the print driver each time in order to
- figure out the page, paper, etc sizes.
-
- Eric Marking
- Andersen Consulting
-
- AppleLink: AACO
-
-